*******This do-file reproduces the tables and figures in the article by Cordova&Hiskey(2019)
******* titled "Development Context and the Political Behavior of Remittance Recipients in Latin America and the Caribbean"
***The data are from the 2010 wave of surveys by the Latin American Public Opinion Project.  

**Table 1. Remittance Dependence
*Model 1
set more off
meologit q10brr hdi2010 gdpgrowth09 edr  mujer q2 	urr	q10 if year==2010 || pais:	, cov(uns) intmethod(laplace) 

*Figure 1
margins,  at(hdi2010=(0.45 (.05) 0.80)) expression(predict(mu fixedonly outcome(2)))
  #delimit; 
 marginsplot, recast(line) recastci(rarea) ciopts(fcolor(gs14) color(gs14)) 
 plot1opts(lcolor(gs0) lpattern(dash)lwidth(thin)) 
 ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr

 **Table 1. Perceptions Personal Economy
set more off
*Model 2
meologit idio1r i.q10ar  gdpgrowth09 m1r edr	 mujer	q2	urr	q10 if	year==2010	|| pais:	, cov(uns)

***Model 3
meologit idio1r i.q10ar c.hdi2010 gdpgrowth09 m1r edr	 mujer	q2	urr	q10 if	year==2010	|| pais:	, cov(uns)
 
***Model 4

meologit idio1r i.q10ar##c.hdi2010 gdpgrowth09 m1r edr	 mujer	q2	urr	q10 if	year==2010	|| pais:	, cov(uns)

*Figure 2 Panels A and B
margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) expression(predict(mu fixedonly outcome(75))+ predict(mu fixedonly outcome(100)))
 #delimit; 
 marginsplot, recast(line) noci  
ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr

 margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) contrast(overjoint effect) expression(predict(mu fixedonly outcome(75))+ predict(mu fixedonly outcome(100)))
 #delimit; 
 marginsplot, recast(line) recastci(rarea) ciopts(fcolor(gs14) color(gs14)) 
 ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr
 
***Table 1. Perceptions National Economy
set more off
*Model 5
meologit soct1r i.q10ar gdpgrowth09  m1r  edr	 mujer	q2	urr	q10 if	year==2010	|| pais:	, cov(uns)
*Model 6
meologit soct1r i.q10ar c.hdi2010 gdpgrowth09  m1r  edr	 mujer	q2	urr	q10 if	year==2010	|| pais:	, cov(uns)
*Model 7
meologit soct1r i.q10ar##c.hdi2010 gdpgrowth09  m1r  edr	 mujer	q2	urr	q10 if	year==2010	|| pais:	, cov(uns)
 
 **Figure 2. Panels C and D
   margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) expression(predict(mu fixedonly outcome(75))+ predict(mu fixedonly outcome(100)))
 #delimit; 
 marginsplot, recast(line) noci  
ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr
 
  margins , over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) contrast(overjoint effect) expression(predict(mu fixedonly outcome(75))+ predict(mu fixedonly outcome(100)))
 #delimit; 
 marginsplot, recast(line) recastci(rarea) ciopts(fcolor(gs14) color(gs14)) 
 ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr
 
 ***Table 2.  Cross-Border Ties with Relatives Living Abroad
set more off
 *Model 1
meologit q16r i.q10ar gdpgrowth09 edr  mujer	q2	urr	q10 if year==2010 || pais: , 

*Model 2
meologit q16r c.hdi2010 i.q10ar gdpgrowth09 edr  mujer	q2	urr	q10 if year==2010 || pais: , 

*Model 3
meologit q16r c.hdi2010##i.q10ar gdpgrowth09  edr  mujer q2 urr	q10 if year==2010 || pais: , 

*Figure 3. Panel A
margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80))expression(predict(mu fixedonly outcome(4))+ predict(mu fixedonly outcome(5)))
 #delimit; 
 marginsplot, recast(line) noci  
ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr
 
*Figure 3. Panel B
 margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80))contrast(overjoint effect)expression(predict(mu fixedonly outcome(4))+ predict(mu fixedonly outcome(5)))
  #delimit; 
 marginsplot, recast(line) recastci(rarea) ciopts(fcolor(gs14) color(gs14)) 
 ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr

 ***Table 3. Civic and Political Participation at the Local Level
*Model 1. Community Participation
set more off
meologit cp8r i.q10ar   gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)
 *Model 2. Community Participation
meologit cp8r i.q10ar c.hdi2010  gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)
*Model 3. Community Participation
meologit cp8r i.q10ar##c.hdi2010  gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)

*Figure 4. Panel A
margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) expression(predict(mu fixedonly outcome(66))+ predict(mu fixedonly outcome(100))) 
 
 #delimit; 
 marginsplot, recast(line) noci  
ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr
*Figure 4. Panel B
  margins , over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) contrast(overjoint effect) expression(predict(mu fixedonly outcome(66))+ predict(mu fixedonly outcome(100)))
 #delimit; 
 marginsplot, recast(line) recastci(rarea) ciopts(fcolor(gs14) color(gs14)) 
 ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr

*Model 4. Requested Help from Local Government
  set more off
melogit cp4ar i.q10ar   gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)
*Model 5. Requested Help from Local Government
 melogit cp4ar i.q10ar c.hdi2010  gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns) 
*Model 6. Requested Help from Local Government
 melogit cp4ar i.q10ar##c.hdi2010  gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)
 
 *Figure 4. Panel C
 margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) predict(mu fixedonly ) 
 #delimit; 
 marginsplot, recast(line) noci  
ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr

 *Figure 4. Panel D
 margins , over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) contrast(overjoint effect) predict(mu fixedonly )
 #delimit; 
 marginsplot, recast(line) recastci(rarea) ciopts(fcolor(gs14) color(gs14)) 
 ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr
 
 ***Table 4. Voter Turnout in National Elections
 *Model 1
 set more off
melogit vb2r i.q10ar gdpgrowth09   eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)

*Model 2
melogit vb2r i.q10ar c.hdi2010  gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)

*Model 3
melogit vb2r i.q10ar##c.hdi2010  gdpgrowth09 eff1 pol1r vic1extrr aoj11r edr	 mujer	q2	agesquared	urr	q10 if	year==2010	|| pais:	, cov(uns)

*Figure 5. Panel A

margins, over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) predict(mu fixedonly ) 
 #delimit; 
 marginsplot, recast(line) noci  
ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr

 *Figure 5. Panel B
margins , over(q10ar) at(hdi2010=(0.45 (.05) 0.80)) contrast(overjoint effect) predict(mu fixedonly )
 #delimit; 
 marginsplot, recast(line) recastci(rarea) ciopts(fcolor(gs14) color(gs14)) 
 ylabel(, nogrid)plotregion(color(white)) graphregion(color(white));
 #delimit cr
